export default {
  /**
   * 获取
   */
  get(key) {
    if (!key) return
    return window.localStorage.getItem(key)
  },
  /**
   * 存储
   */
  set(key, value) {
    if (!key) return
    if (typeof value !== 'string') {
      value = JSON.stringify(value)
    }
    window.localStorage.setItem(key, value)
  },
  /**
   * 删除
   */
  remove(key) {
    if (!key) return
    window.localStorage.removeItem(key)
  }
}
